/**
 *  设备相关接口
 * **/

import request from '@/common/request.js';
import {HTTP_REQUEST_URL} from '@/config.js'; 

const zncp_api={};

//扫码
zncp_api.scan = data => request.globalRequest({
	methods: 'POST',
	url: HTTP_REQUEST_URL+'/zncpdevice/scan.do',   
	data: data   
}); 

zncp_api.scan = data => request.globalRequest({
	methods: 'POST',
	url: HTTP_REQUEST_URL+'/zncpdevice/scan.do',   
	data: data   
}); 

//添加设备
zncp_api.addDev = data => request.globalRequest({
	methods: 'POST',
	url: HTTP_REQUEST_URL+'/zncpdevice/scanone.do',   
	data: data   
}); 

//安装设备  立即拍照
zncp_api.add_device_work = data => request.globalRequest({
	methods: 'POST',
	url: HTTP_REQUEST_URL+'/zncpdevice/add-device-work.do',   
	data: data   
}); 

// 监测列表
zncp_api.getDevList = data => request.globalRequest({
	methods: 'POST',
	url: HTTP_REQUEST_URL+'/zncpdevice/devices.do',   
	data: data   
}); 

zncp_api.getDevPhoto = data => request.globalRequest({
	methods: 'POST',
	url: HTTP_REQUEST_URL+'/zncpdevice/device-photo.do',   
	data: data   
});

zncp_api.delphoto = data => request.globalRequest({
	methods: 'POST',
	url: HTTP_REQUEST_URL+'/zncpdevice/delpho.do',   
	data: data   
});

zncp_api.deviceinfo = data => request.globalRequest({
	methods: 'POST',
	url: HTTP_REQUEST_URL+'/zncpdevice/deviceinfo.do',   
	data: data   
});


// 点击某个设备进入‘设备控制’页面，https://api.honghuoyi.com/zncpdevice/scan?number=xxxxx，提交就是'设备控制'
// https://api.honghuoyi.com/zncpdevice/add_device_work
// id设备ID
// camera_interval设置拍照时间
// device_status状态（开启1  关闭0）


// 验证设备密码
// https://api.honghuoyi.com/zncpdevice/scan?number=xxxxx&type=1&password=147258

// 获取天气信息  (高德api)
zncp_api.getWeather = data => request.globalRequest({ 
	methods:'get',
	url: 'https://restapi.amap.com/v3/weather/weatherInfo',   
	data: data   
}) 

// 获取省份列表 
zncp_api.getProvince= data => request.globalRequest({
	methods: 'POST', 
	url:  'https://api.honghuoyi.com/yun/area-list',   
	data: data   
})

// 获取街道 
zncp_api.getStreet= data => request.globalRequest({
	methods: 'POST', 
	url:  'https://api.honghuoyi.com/yun/street',   
	data: data   
})


 
export default zncp_api;






